package com.yoake.campus.service.impl;

import java.util.List;
import com.yoake.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.yoake.campus.mapper.CampusCommentMapper;
import com.yoake.campus.domain.CampusComment;
import com.yoake.campus.service.ICampusCommentService;

/**
 * 评论管理Service业务层处理
 * 
 * @author yoake
 * @date 2024-12-22
 */
@Service
public class CampusCommentServiceImpl implements ICampusCommentService 
{
    @Autowired
    private CampusCommentMapper campusCommentMapper;

    /**
     * 查询评论管理
     * 
     * @param commentId 评论管理主键
     * @return 评论管理
     */
    @Override
    public CampusComment selectCampusCommentByCommentId(Long commentId)
    {
        return campusCommentMapper.selectCampusCommentByCommentId(commentId);
    }

    /**
     * 查询评论管理列表
     * 
     * @param campusComment 评论管理
     * @return 评论管理
     */
    @Override
    public List<CampusComment> selectCampusCommentList(CampusComment campusComment)
    {
        return campusCommentMapper.selectCampusCommentList(campusComment);
    }

    /**
     * 新增评论管理
     * 
     * @param campusComment 评论管理
     * @return 结果
     */
    @Override
    public int insertCampusComment(CampusComment campusComment)
    {
        campusComment.setCreateTime(DateUtils.getNowDate());
        return campusCommentMapper.insertCampusComment(campusComment);
    }

    /**
     * 修改评论管理
     * 
     * @param campusComment 评论管理
     * @return 结果
     */
    @Override
    public int updateCampusComment(CampusComment campusComment)
    {
        campusComment.setUpdateTime(DateUtils.getNowDate());
        return campusCommentMapper.updateCampusComment(campusComment);
    }

    /**
     * 批量删除评论管理
     * 
     * @param commentIds 需要删除的评论管理主键
     * @return 结果
     */
    @Override
    public int deleteCampusCommentByCommentIds(Long[] commentIds)
    {
        return campusCommentMapper.deleteCampusCommentByCommentIds(commentIds);
    }

    /**
     * 删除评论管理信息
     * 
     * @param commentId 评论管理主键
     * @return 结果
     */
    @Override
    public int deleteCampusCommentByCommentId(Long commentId)
    {
        return campusCommentMapper.deleteCampusCommentByCommentId(commentId);
    }
}
